# coding: utf-8
# @Author: cyl
# @File: cas_enum.py
# @Time: 2022/06/21 15:49:08
from enum import Enum, unique


@unique
class FormSubmitStatus(Enum):
    """质检计量客户端: 表单状态"""
    UNLAUNCH = "0"           # 未发起
    PROCESSING = "1"         # 审批中
    PASSED = "2"             # 已完成
    BACK = "-1"              # 已退回
    BACKTOORIGINATOR = "-2"  # 退回至发起人
    SUBMITARCHIVE = "10"     # 提交归档
    ARCHIVED = "11"          # 归档成功


@unique
class FormApprovalStatus(Enum):
    """质检计量客户端: 表单审批状态"""
    NOSIGNATURE = "-4"       # 未签章
    NOPROCESSEXIST = "-3"    # 流程不存在
    NOPERMISSION = "-2"      # 无权限审批
    NOPROCESSSUBMIT = "-1"   # 流程未提交
    PROCESSDONE = "0"        # 流程已执行完毕
    APPROVALSUCCESS = "1"    # 审批成功


@unique
class TreeNodeType(Enum):
    """质检计量客户端: wbs左侧树节点类型"""
    DanWei = "0"       # 单位节点
    ZiDanWei = "1"     # 子单位节点
    FenBu = "2"        # 分部节点
    ZiFenBu = "3"      # 子分部节点
    FenXiang = "4"     # 分项节点
    ZiFenXiang = "5"   # 子分项节点
    GouJian = "6"      # 构件
    GongXu = "7"       # 工序
    JianYanPi = "8"    # 检验批

@unique
class TreeNodeStatus(Enum):
    """质检客户端: wbs树节点状态"""
    NOTSTART = 0    # 未开工
    COMMENCED = 1   # 已开工
    VERIFIED = 2    # 已校验
    ASSESSED = 3    # 已评定
    MEASURED = 4    # 已计量
    ARCHIVED = 5    # 已归档


@unique
class LabSampleAuthType(Enum):
    """试验室: 样品管理权限"""
    SAMPLEADD = "192:laboratory:samplemng:add"         # 新增
    SAMPLECOPY = "192:laboratory:samplemng:copy"       # 复制
    SAMPLEDELETE = "192:laboratory:samplemng:delete"   # 删除
    SAMPLEDETAIL = "192:laboratory:samplemng:detail"   # 详情
    SAMPLEEDIT = "192:laboratory:samplemng:edit"       # 编辑


@unique
class LabReportAuthType(Enum):
    """试验室: 数据报告权限"""
    REPORTADD = "192:laboratory:datareport:add"                   # 新增
    REPORTDELETE = "192:laboratory:datareport:delete"             # 删除
    REPORTFORMEDIT = "192:laboratory:datareport:formedit"         # 表单编辑
    REPORTFORMREAD = "192:laboratory:datareport:formread"         # 查看表单
    REPORTDETAIL = "192:laboratory:datareport:detail"             # 查看详情
    REPORTRELATION = "192:laboratory:datareport:samplerelation"   # 样品关联
    REPORTVIEWPROCESS = "192:laboratory:datareport:viewprocess"   # 查看流程
    REPORTVIEWSAMPLE = "192:laboratory:datareport:viewsample"     # 查看样品
